<?php if(isset($page_data)&&!empty($page_data)){?>
<div class="jppager">
            <nav>
  <ul class="pagination">
    <li>
      <a href="<?php echo $page_data["url"]; ?>&page=<?php echo $page_data["prev"]; ?>" aria-label="Previous">
        <span aria-hidden="true">&laquo;</span>
      </a>
    </li>
    <?php for($i=1;$i<=$page_data["total_pages"];$i++){?>
    <?php if($page_data["cur"]-4>1&&$i==2){$i=$page_data["cur"]-4;}elseif($i==$page_data["cur"]+4&&$page_data["cur"] + 4 < $page_data["total_pages"]){$i = $page_data["total_pages"] - 1;}else{?>
    <li <?php if($i==$page_data["cur"]) echo "class='active'";?>><a href="<?php echo $page_data["url"]; ?>&page=<?php echo $i; ?>"><?php echo $i;?></a></li>
    <?php }?>
    <?php }?>
    
    <li>
      <a href="<?php echo $page_data["url"]; ?>&page=<?php echo $page_data["next"]; ?>" aria-label="Next">
        <span aria-hidden="true">&raquo;</span>
      </a>
    </li>
  </ul>
</nav>
</div>
<?php }?>